﻿@using PagedList.Mvc;
@using PagedList;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
    if (!String.IsNullOrEmpty(ViewBag.Msg))
    {
    <script>        alert("@ViewBag.Msg")</script>
    }
}
<div class="site_map">
    @Html.ActionLink("Home", "Index", "Home") / Subjects</div>
<br />
<div class="search_content">
    @using (Ajax.BeginForm("Index", "Subject", new AjaxOptions
        {
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "GET",
            UpdateTargetId = "unobtrusive",
        }, new
        {
            @class
            = "form-inline"
        }))
    {
        @Html.TextBox("keyWord", "", new { placeholder = "Name or Code" })
        <button type="submit" value="Search" class="btn" style="width: 80px">
            Search</button>
        @Html.ActionLink("Reload", "Index", "Subject", null, new { @class = "btn", style = "width:54px" })
    }
</div>
<br />
@{
    if (HttpContext.Current.User.IsInRole("1"))
    {
    <span>@Html.ActionLink("Create Subject", "Create", null, new { @class = "btn" })</span>
    <span>@Html.ActionLink("Import Subjects", "Import", null, new { @class = "btn" })</span>
    <span>@Html.ActionLink("Import Participants", "Import", "Participant", null, new { @class = "btn" })</span>
    <br />
    <br />
    }
}
<div id="unobtrusive">
    @Html.Partial("_List")
</div>
